//
//  testView.m
//  ActionsMemorandum
//
//  Created by _LJX on 2017/10/26.
//  Copyright © 2017年 _LJX. All rights reserved.
//

#import "testView.h"
#import "SingleModle.h"
#import "MemorandumModle.h"
#import "UploadData.h"
@interface testView ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;


@end

@implementation testView


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return  [SingleModle shareData].DataCache.count;
    
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *TableSampleIdentifier = @"TableSampleIdentifier";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:
                             TableSampleIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc]
                initWithStyle:UITableViewCellStyleSubtitle
                reuseIdentifier:TableSampleIdentifier];
        
    }
    MemorandumModle *mem =[[MemorandumModle alloc]initWithDict:[SingleModle shareData].DataCache[indexPath.row]];
    cell.textLabel.text =mem.title;
    cell.detailTextLabel.text = mem.time;
    return cell;
    
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [UploadData WriteData];
    [UploadData ReadData];
    NSLog(@"%@",[SingleModle shareData].DataCache);
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
